filename=base-xxl-job.jar
PID=$(ps -ef | grep $filename | grep -v grep | awk '{ print $2 }')
if [ ${PID} ]; 
then
 echo 'Application xxl-job is stpping...'
 echo kill $PID DONE
 kill -9 $PID
else
 echo 'Application xxl-job is already stopped...'
fi

mv /home/jenkins_home/workspace/wjboot/base/base-xxl-job/target/$filename /home/wjboot/$filename
cd /home/wjboot/
BUILD_ID=dontKillMe nohup java -Xms512m -Xmx512m -jar $filename >xxl-job-log.out 2>1 &

var=$(date +%Y%m%d%H%M)
cp $filename $var$filename
echo "backup xxl-job jar success!"
